// @ts-ignore
/* eslint-disable */
import { ModelType } from 'umi';
import * as sysMenuService from '@/services/sys/sysMenuService';

const SysMenu: ModelType = {
  namespace: 'sysMenu',

  state: {
    name: '',
  },

  effects: {



    *findMenuTree({ payload, callback }:any, { call }:any) {
      const response = yield call(sysMenuService.findMenuTree, payload);
      if (callback) {
        callback(response)
      }
    },
    *findRoleMenuTree({ payload, callback }:any, { call }:any) {
      const response = yield call(sysMenuService.findRoleMenuTree, payload);
      if (callback) {
        callback(response)
      }
    },
    *updateRoleMenu({ payload, callback }:any, { call }:any) {
      const response = yield call(sysMenuService.updateRoleMenu, payload);
      if (callback) {
        callback(response)
      }
    },
    *saveObject({ payload, callback }:any, { call }:any) {
      const response = yield call(sysMenuService.saveObject, payload);
      if (callback) {
        callback(response)
      }
    },
    *updateObject({ payload, callback }:any, { call }:any) {
      const response = yield call(sysMenuService.updateObject, payload);
      if (callback) {
        callback(response)
      }
    },
    *fakeDelete({ payload, callback }:any, { call }:any) {
      const response = yield call(sysMenuService.fakeDelete, payload);
      if (callback) {
        callback(response)
      }
    },
  },

};

export default SysMenu;
